<template>
	<CreateVideoList @receive="onReceiveVideo" :extensions="extensions" />
</template>

<script setup lang="ts">
	import { ref, reactive } from 'vue'
	import { setConfig, CreateVideoList } from '@bytedance-ad/mui-vue3'
	defineOptions({
	  name: 'OceanEnginelVideo',
	})
	const props = defineProps({
		listParam: {
			type: String,
			default: null,
		},
		advertiser_id:{
			type: Number,
			default: null,
		}
	})
	const extensions = ref({
		max: 10,
	})
	setConfig({
		appId: '1806716056834058', // 必填，否则无法使用MUI, 可在后台管理系统https://open.oceanengine.com/developer/admin/ad_list获取
		host: import.meta.env.VITE_BASE_API,
		params: { // 可选，自定义每次请求的参数
			advertiser_id: props.advertiser_id,
		},
		apis: {
			getImages: '/openApi/file/image/get/', //获取图片
			uploadImage: '/openApi/file/image/ad/', //上传图片
			getVideos: '/openApi/file/video/get/',  //获取视频
			uploadVideo: '/openApi/file/video/ad/', //上传视频
			getAudio: '/openApi/file/audio/get/',  //获取音频
			uploadAudio: '/openApi/file/audio/ad/', //上传音频
			getCarousel: '/openApi/carousel/list/',//获取图文素材
			uploadCarousel: '/openApi/carousel/create/',//上传图文
		}
	})
	const onReceiveVideo = (value) => {
		emit('onReceiveVideo', value)
	};
	const emit = defineEmits(['onReceiveVideo'])
</script>

<style scoped>
</style>